#include <stdio.h>
#include <unistd.h>

#define atomic_inc(x) __sync_fetch_and_add((x),1)  
#define atomic_dec(x) __sync_fetch_and_sub((x),1)  
#define atomic_add(x,y) __sync_fetch_and_add((x),(y))  
#define atomic_sub(x,y) __sync_fetch_and_sub((x),(y))

void add3_1(int *a) {
	*a+=3;
}
void add3_1_1(char *a) {
	*a = (*a) + 3;
}


void add3_2(volatile int *a) {
	*a+=3;
}

void add3_3(int *a) {
	__sync_fetch_and_add(a, 3);
}


int main(int argc, char** argv) {
	int a = 0;
	volatile int b = 0;
	char c = 0;
	add3_1(&a);
	add3_1_1(&c);
	add3_2(&b);
	add3_3(&a);
	return 0;
	
	
}
